package com.slt.designpatterns.factory.mashibing;

import com.slt.designpatterns.factory.mashibing.factoryMethod.CarFactory;
import org.junit.Test;

/**
 * 演变过程
 *   任意定制交通工具
 *      继承moveable
 *   任意定制生产过程
 *      XXXFactory().create()
 *   任意定制产品一族
 */
public class Main {
    public static void main(String[] args) {
        Moveable m = new CarFactory().create();
        m.go();

    }

    /**
     * 不使用工厂的时候的写法
     */
    @Test
    public void test01(){
        // 开汽车
        Car car = new Car();
        car.go();
        //开飞机
        Plane plane = new Plane();
        plane.go();

        //骑扫帚
        Moveable moveable = new Broom();
        moveable.go();
    }
}
